<!DOCTYPE html>
<html lang="zh-cmn-Hans"  xmlns:th="http://www.thymeleaf.org">
<head>
    <title>用户界面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../static/layui/css/layui.css"  media="all">
    <script src="../../static/js/jquery.js"></script>
    <script src="../../static/js/jquery-ui.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-nightly@5.1.2-dev.20210512/dist/echarts.min.js"></script>
    <script th:inline="javascript">
        $(function(){
            document.getElementById('videodiv').style.display='block';
            document.getElementById('shidudiv').style.display='none';//设置刚进入的时候什么都不显示，即主页

            $("#videodd").on("click", function() {//点击商品表隐藏其他两个表
                document.getElementById('videodiv').style.display='block';
                document.getElementById('shidudiv').style.display='none';
            })
            $("#shidudd").on("click", function() {
                document.getElementById('videodiv').style.display='none';
                document.getElementById('shidudiv').style.display='block';
            })
        })
    </script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">宿舍管理系统</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img src="../../static/images/touxiang.jpg" class="layui-nav-img">
                    张三
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">Your Profile</a></dd>
                    <dd><a href="">Settings</a></dd>
                    <dd><a href="">Sign out</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a href="javascript:;">
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo" style="margin-right: 10px;">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="photo">安全保障</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" id="videodd">视频监控</a></dd>
                        <dd><a href="javascript:;" id="shidudd">湿度监控</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="sleep">定时查寝</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">报寝</a></dd>
                        <dd><a href="javascript:;">信息查看</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">用户信息维护</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">用户信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">生活休闲</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">饮水机管理</a></dd>
                        <dd><a href="javascript:;">宠物喂食</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body" style="left: 200px">
        <div id = "videodiv" style="padding: 15px;">
            <p>直播：</p>
            <img style="-webkit-user-select: none;margin: auto;background-color: hsl(0, 0%, 25%);"
                 src="http://localhost:5000/video_viewer" width="498" height="373">
            <br/>
            <p>录像：</p>
            <div id="videoList">
                <video width="320" height="240" controls>
                    <source src="{{ url_for("static", filename="aaa.mp4") }}" type="video/mp4">
                    <source src="movie.ogg" type="video/ogg">
                    您的浏览器不支持 video 标签。
                </video>
            </div>
        </div>
        <div id = "shidudiv" style="padding: 0px;">
            <img src="../../static/images/shidu.png" width="502" height="296">
            <span class="layui-text" style="font-size: large">
                tips:现在湿度为27%，相对比较干燥，请注意补水。
            </span>
            <div id="container" style="height: 350px"></div>
            <label style="padding-left: 550px" class="layui-text">湿度变化图</label>
            <br/>
            <br/>
            <br/>
        <script type="text/javascript">
            var dom = document.getElementById("container");
            var myChart = echarts.init(dom);
            var app = {};

            var option;



            option = {
                xAxis: {
                    type: 'category',
                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                    data: [0.27, 0.3, 0.5, 0.6, 0.55, 0.3, 0.7],
                    type: 'line',
                    smooth: true
                }]
            };

            if (option && typeof option === 'object') {
                myChart.setOption(option);
            }

        </script>
        </div>
    </div>
    <script type="text/html" id="orderBar">
        <input type="button" class="layui-btn layui-btn-sm" lay-event="increaseItem" value="提醒">
    </script>
</div>
<script src="../../static/layui/layui.js"></script>
<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){
                layer.open({
                    type: 1
                    ,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
            }
        });

    });
</script>
<script>
    layui.use('element', function(){
      var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

      //监听导航点击
      element.on('nav(demo)', function(elem){
        //console.log(elem)
        layer.msg(elem.text());
      });
    });
</script>
</body>
</html>